const WxParse = require('../../wxParse/wxParse.js');
import article from "../../models/Atricle"
Page({
  data: {
    article:{},
    body:{}
  },
  onLoad: function (options) {
    // 获取id
    let id = options.id;
    article.datail(id).then(ret => {
      this.setData({
        article:ret.data.data
      });
      // WxParse.wxParse('body', 'html', ret.data.data.body, this, 3);
      WxParse.wxParse("body","html",ret.data.data.body,this,3);
      wx.setNavigationBarTitle({
        title: '黑马程序员-'+ret.data.data.title.substr(0,5),
      });
    })
  },
})